package remotecontrolcase.command.garagedoor;

import remotecontrolcase.command.Command;
import remotecontrolcase.component.GarageDoor;

/**
 * description:
 *  打开车库门命令对象
 * @author yuanmenglv on 2019/11/30
 */
public class GarageDoorOpenCommand implements Command {
    private GarageDoor garageDoor;

    public GarageDoorOpenCommand(GarageDoor garageDoor) {
        this.garageDoor = garageDoor;
    }

    @Override
    public void execute() {
        garageDoor.open();
    }

    @Override
    public void undo() {
        System.out.println("撤销中");
        garageDoor.close();
    }
}
